<template>
  <div class="z-panel">
    <div class="z-panel-title" @click="showSlot">
      <div>
        <span class="setpnum">{{ config.index }}</span
        ><span>{{ config.title }}</span>
      </div>
      <div class="icon">
        <i class="el-icon-arrow-down" v-if="!show"></i>
        <i class="el-icon-arrow-up" v-else></i>
      </div>
    </div>
    <div class="z-panel-cont" v-if="show">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "z-panel",
  props: {
    config: {
      type: Object,
      default: () => { }
    }
  },
  data () {
    return {
      show: true
    }
  },

  created () {

  },
  methods: {
    showSlot () {
      this.show = !this.show
    }
  }
}

</script>
<style scoped lang='scss'>
.z-panel {
  box-shadow: 0px 2px 20px 0 rgb(180, 177, 177);
  border-radius: 25px;
  margin: 40px 140px;
  padding: 30px 40px 30px 40px;
  &-title {
    display: flex;
    justify-content: space-between;
    font-size: 30px;
    font-weight: 700;
    .icon {
      width: 50px;
      height: 50px;
      text-align: center;
      line-height: 50px;
      cursor: pointer;
      .el-icon-arrow-down,
      .el-icon-arrow-up {
        font-size: 36px;
        font-weight: 700;
      }
    }
    .setpnum {
      display: inline-block;
      width: 40px;
      height: 40px;
      text-align: center;
      line-height: 40px;
      margin-right: 30px;
      border: 3px solid black;
      border-radius: 50%;
      font-size: 25px;
    }
  }
  &-cont {
    margin-top: 40px;
    padding: 0 90px 0 90px;
  }
}
</style>